<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>面向对象-封装-继承-多态</title>
</head>

<body>
    <script>
        function Stu(name) {
            this.name = name;
        }
        //原型对象
        Stu.prototype.say = function() {
            console.log("说谎了");
        }





        function Man(n) {
            Stu.call(this, n)
            this.age = 19 //多态
        }
        Man.prototype = Stu.prototype; //原型链继承
        let o2 = new Man("gao")
        console.log(o2);
    </script>
</body>

</html>